package lesson01;

import java.sql.SQLOutput;

/**
 * 匿名内部类创建 Runnable 子类对象
 *
 * @author wileda
 * @date 2023/01/03  17:40
 */
public class Demo05 {
    public static void main(String[] args) {
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                int count = 0;
                while (true){
                    count++;
                    System.out.println("匿名内部类创建 Runnable 子类对象");
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        });
        thread.start();
    }
}